package com.healthdata.dao;

import com.healthdata.entity.HospitalCost;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface HospitalCostMapper extends BaseMapper<HospitalCost> {

    @Select("SELECT * FROM comprehensive_hospital_cost WHERE level = #{level}")
    List<HospitalCost> findByLevel(String level);

    @Select("SELECT * FROM comprehensive_hospital_cost WHERE year BETWEEN #{startYear} AND #{endYear}")
    List<HospitalCost> findByYearBetween(Integer startYear, Integer endYear);

    @Select("SELECT * FROM comprehensive_hospital_cost WHERE level = #{level} AND year BETWEEN #{startYear} AND #{endYear}")
    List<HospitalCost> findByLevelAndYearBetween(String level, Integer startYear, Integer endYear);
}